home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Enigma Amiga Life 112
/
EnigmaAmiga112CD.iso
/
dalla rivista
/
amiga.free
/
tableplug12
/
rx
/
tvpaint.tpx
< prev
Wrap
Text File
|
1999-10-11
|
1KB
|
68 lines
/*
tvpaint.tpx v1.0 © 1999 Esteve Boix
This module uses TVPaint to load the image, scale it down
and save it as JPEG file.
Tested only on the freeware version 3.59.
Also deletes the 'info' file generated by TVPaint.
Args: SIZEX SIZEY JPEG_COMPRESSION
Where:
SIZEX, SIZEY Size in pixels of the thumbnail
JPEG_COMPRESSION Well...
*/
multiview="sys:utilities/multiview" /* Modify if necessary */
options results
parse arg maxsizex maxsizey compression infile outfile
infile=strip(infile)
outfile=strip(outfile)
address 'rexx_TVPaint'
tv_LoadProject infile
if rc~=0 then exit
/* Obtain info about the image */
tv_getwidth
x = result
tv_getheight
y = result
/* ...and calculate the thumbnail resolution */
comp=trunc((maxsizex/x)*y)
if comp<=maxsizey then do
tv_resizepage maxsizex comp 2 /* Discovered after some attempts... */
end
else do
comp2=trunc((maxsizey/y)*x)
tv_resizepage comp2 maxsizey 2 /* Discovered after some attempts... */
end
/* And save the image */
tv_savemode jpeg compression
tv_savedisplay outfile
address command
'delete '||outfile||'.info' /* Delete the info file */